package main

import (
	"api/appconfig"
	"api/cache"
	"api/models"
	_ "api/routers"
	beego "github.com/beego/beego/v2/server/web"
	"github.com/beego/beego/v2/server/web/filter/cors"
)

func main() {
	beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
		AllowAllOrigins: true,
		AllowOrigins:    []string{"*"},
		AllowMethods:    []string{"*"},
		AllowHeaders:    []string{"*"},
	}))
	appconfig.Init()
	models.Init()
	cache.Init()
	beego.Run()
}
